<template lang="">
    <div>
        {{ text }}
    </div>
    <div>
        {{ text }}
    </div>
    <button @click="setText">设置1</button>
    <button @click='setText'>设置2</button>
</template>
<script>
export default {
    data(){
        return{
            text:''
        }
    },
    methods: {
        setText(){
            // // this.text = '1'
            // setTimeout(() => {
            // this.text ='2'
            // },2000)
            console.log(666666)
            setTimeout(function(){
            console.log(9999999)
            console.log(this.text)
            this.text='2'
        },1000)
        console.log(123123123)
    },
    setText2(){
        const pro = new Promise((resolv,reject)=>{
            setTimeout(() => {
console.log(11111111)
this.data1=2
resolv(this.data1)
            },2000)
        }
    )
    // console.log(pro,5555555)
    pro.then((num) => {
        console.log(num,321)
    }).catch(() => {

    }).finally(()=>{
        console.log('douzhixingle1')
    })
    const pro1 =new Promise((resolv,reject)=>{
    setTimeout(() =>{
        console.log(1111111)
        this.data1=2
    },2000)
    setTimeout(()=>{
        console.log(222222)
        // TODO:
        this.data2 =3
    },2000)
})
Promise.all([pro.pro1]).then(res=>{}).chath()
}
}
}
</script>
<style lang="">
    
</style>